<?php
/**
 * OS CRM SYSTEM - An open source application development framework for PHP 4.3.2 or newer
 *
 * CLASS - DASHBOARD
 * 
 * @name      dashboard
 * @package		OS CRM
 * @category  Class
 * @author		CRM SYSTEM Dev Team
 * @copyright	Copyright (c) 2010 - 2012, CRM SYSTEM
 * @since     Version 1.0
 * @filesource
 * @access    public 
 */

// ------------------------------------------------------------------------

class dashboard extends Controller {
  
  /*common class varibale*/
  var $c 	= 'dashboard';//current controler
	var $p_c = '';//parent controller
  
  //set db - listing data
	var $e_list_limit 	= '10';
	var $e_list_offset 	= '0';
	var $e_list_order   = 'asc';
	var $e_list_order_by= ''; 
  
  /*message strings*/
  var $valid_success 	= '';
  var $valid_errors 	= '';
  var $valid_notice 	= '';
  
  /**
   * login  - constructor of the c;ass
   * 
   * @access public
   * @param  NA
   * @return void
   */
	function dashboard()
	{
		parent::Controller();	
    
    if(!__is_loggedin()){
      redirect('login');
    }   
    
    $this->load->model('DB_F_Model', 'db_model');
	}
	
  // ------------------------------------------------------------------------

  /**
   * index  - default function
   * 
   * @access public
   * @param  NA
   * @return void
   */
	function index()
	{
    $data = array();
    $data = $this->db_model->fr_get_stats_data();
		$data['cont_title'] = 'Dashboard';
    
    $data['frm_name']   = 'frmjournallist';
    $data['frm_action'] = site_url( $this->c );
    
		//set crontroller info
		$data['c'] 		= $this->c;
		$data['p_c'] 	= $this->p_c;
        
    /*set message strings*/
    $data['msg_info']['valid_errors'] = $this->session->flashdata('valid_errors');
    $data['msg_info']['valid_notice'] = $this->session->flashdata('valid_notice');
    $data['msg_info']['valid_success'] = $this->session->flashdata('valid_success');
    __display('dashboard', $data);
    
	}
  
  /*function testemail(){
    $this->load->plugin('phpmailer');
    send_smtp_email_admin('THis is a test','This is a mailer test from mail function')        ;
  }*/
	
}

/* End of file login.php */
/* Location: ./system/application/modules/login/controllers/login.php */